package com.xl.core.util;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;

public class DuplicateUtil {

	private static final String COOKIE_TOKEN = "COOKIE_TOKEN";

	public static void removeDuplicate(HttpServletRequest request) {

		Cookie[] cookies = request.getCookies();
		String key = "";
		if (null != cookies) {
			for (Cookie cook : cookies) {
				if (COOKIE_TOKEN.equals(cook.getName())) {
					key = cook.getValue();
					break;
				}
			}

			Object obj = JedisUtil.get(key);
			if (null != obj) {
				JedisUtil.del(key);
			}

		}

	}

}
